<template>
    <div>
        <input type="text" v-model.number.trim="const1">
        <button @click="submit">提交</button>
    </div>
</template>
<script>
export default {
    name:'text-diba',
    data(){
        return{
            const1:10
        }
    },
    methods:{
        submit(){
            if(!this.const1){
                alert('内容不为空')
            }
            console.log(`输入的内容为：${this.const1}`);
        }
    }

}
</script>